Home |
| Latest | About | Random
# Week 2 Thursday 6/29 brief notes. Reading: Read 7.2, 7.3. Finish reading 7.1. So far we saw how to deal with integrals of rational functions (using partial fraction decomposition); and how to deal with "products" in an integral (using integration by parts, $\int udv=uv-\int vdu$). Today we will deal with integrals that involve trigonometric functions. But before we do that, let me give you a special case for integration by parts called **tabular integration** to deal with repeated integration by parts. ## Tabular integration / SDI method. Suppose we want to find $\displaystyle \int P(x)Q(x)dx$. Let us denote $P^{(k)}(x)$ to be the $k$-th derivative of $P$, namely $P^{(k)}(x) = \underbrace{\frac{d}{dx}\cdots \frac{d}{dx}}_{k\text{ times}}P(x)$, and denote $Q^{(-n)}(x)$ to be the $k$-th antiderivative of $Q$, namely $Q^{(-n)}(x) = \underbrace{\int\cdots\int}_{k\text{ times}}Q(x)$. Warning, this is not the inverse of $Q$! Then if we construct the table: $$ \begin{matrix} S & D & I \\\hline \color{blue}+ & \color{blue}P(x) & Q(x)\\ \color{red}- & \color{red}P'(x) & \color{blue} Q^{(-1)}(x)\\ \color{orange}+ & \color{orange}P''(x) & \color{red} Q^{(-2)}(x)\\ - & P'''(x) & \color{orange}Q^{(-3)}(x)\\ \vdots \\ \color{lime}(-1)^{n-1} & \color{lime}P^{(n-1)}(x) & Q^{(-n+1)}(x)\\ \color{olive}(-1)^n & \color{olive}P^{(n)}(x) & \color{darkgreen} Q^{(-n)}(x) \end{matrix} $$ where first column are **alternating signs**, starting from $+$, the second column are the **derivatives** of $P$ , and the last column the **iterated antiderivatives** of $Q$. Then $$ \begin{align*} &\int P(x)Q(x)dx = \\ &{\color{blue}+PQ^{(-1)}}{\color{red}-P' Q^{(-2)}}{\color{orange}+P''Q^{(-3)}}-\cdots+{\color{lime}(-1)^{n-1}P^{(n-1)}Q^{(-n)}} +{\color{green}(-1)^n\int P^{(n)}(x)Q^{(-n)}(x)dx} \end{align*} $$ Notice at the end, we traded with a final integral $\displaystyle(-1)^n\int P^{(n)}(x)Q^{(-n)}(x)dx$. If $P^{(n)}=0$, then we don't even need to write it down! This works because we really are just doing integration by parts repeatedly. **Example.** Let us try to find $\displaystyle\int (5x^2+3x-1)\sin(3x)dx$ by this method. $\blacktriangleright$ Notice here we know $5x^2+3x-1$ will eventually become $0$ by repeated differentiation, and that $\sin(3x)$ we can find its repeated integration easily, so by the tabular method: $$ \begin{matrix} S & D & I \\ + & 5x^2+3x-1 & \sin(3x) \\ - & 10x+3 & -\frac{1}{3}\cos(3x) \\ + & 10 & -\frac{1}{9}\sin(3x) \\ - & 0 & \frac{1}{27}\cos(3x) \end{matrix} $$So by tabular integration we have $$ \begin{align*} &\int (5x^2+3x-1)\sin(3x)dx \\ = & (5x^2+3x-1)\left( -\frac{1}{3}\cos(3x) \right)-(10x+3)\left( -\frac{1}{9}\sin(3x) \right) + 10\cdot \frac{1}{27}\cos(3x) - \int0 dx+C \end{align*} $$ This is useful when we anticipated we need repeated by parts, and that **one term have eventual zero derivative**. **Example.** Find $\displaystyle\int \frac{3x^2-x+1}{\sqrt{4x+3}}dx$. $\blacktriangleright$ This looks scary but notice that $3x^2-x+1$ eventually differentiates to zero, and that $\frac{1}{\sqrt{4x+3}}=(4x+3)^{- 1 / 2}$ are reasonable to integrate repeatedly (by $u$-sub and power rule). So we have $$ \begin{matrix} S & D & I \\ + & 3x^2-x+1 & (4x+3)^{-1 / 2} \\ - & 6x-1 & \frac{2}{4}(4x+3)^{1/ 2} \\ + & 6 & \frac{2}{4} \frac{2}{3} \frac{1}{4} (4x+3)^{3 /2} \\ - & 0 & \frac{2}{4} \frac{2}{3} \frac{1}{4} \frac{2}{5} \frac{1}{4} (4x+3)^{5/ 2} \end{matrix} $$So $$ \begin{align*} & \int \frac{3x^2 - x + 1}{\sqrt{4x+3}}dx \\ = & (3x^2-x+1) \frac{2}{4}(4x+3)^{1 / 2}-(6x-1) \frac{1}{12}(4x+3)^{3 / 2} + 6 \cdot \frac{1}{120}(4x+3)^{5 /2} \end{align*} $$(after some brief simplification.) $\blacklozenge$ **Example.** Find $$ \int e^{2x}\cosh(x)dx $$ $\blacktriangleright$ Let us try this with tabular method: $$ \begin{matrix} S & D & I \\\hline + & e^{2x} & \cosh(x) \\ - & 2e^{2x} & \sinh(x) \\ + & 4e^{2x} & \cosh(x) \end{matrix} $$This means: $$ \begin{align*} \int e^{2x}\cosh(x)dx=+e^{2x}\sinh(x)-2e^{2x}\cosh(x)+\int 4 e^{2x}\cosh(x)dx \end{align*} $$Which we see we get repeated terms. So if we denote original integral as $\displaystyle I=\int e^{2x}\cosh(x)dx$, then $$ I=e^{2x}\sinh(x)-2e^{2x}\cosh(x)+4I $$whence upon solving for $I$, we get $$ I=-\frac{1}{3}(e^{2x}\sinh(x)-2e^{2x}\cosh(x))+C. \quad\blacklozenge $$ ## Trigonometric integrals. (7.2) We now deal with integrals that features mainly trigonometric functions. From integration by parts, we know we can deal with integrals like $\int \sin^n(x)dx$ using a reduction formula. We will now show you an alternative by exploiting trigonometric identities. The idea is that trigonometric functions are often **algebraically linked** to one another, as well as **analytically linked** (related by calculus identities). So we combine them to help us resolve integrals. ## Integrals of the form $\int \sin^n(x)\cos^m(x)dx$. These integrals actually show up quite often in math and science, so it pays to figure out how to integrate them. We will describe two main cases. **Case 1: When either $n$ or $m$ is odd.** If one of the power is **odd**, then take one factor out and put it next to $dx$. - If the one you take out is $\sin(x)$, then now we have $\sin(x)dx=-d(\cos(x))$. - Then using Pythagorean identity $\cos^2(x)+\sin^2(x)=1$, you can write the remaining expression in **entirely in $\cos(x)$**. - Now perform $u$-substitution with $u=\cos(x)$. Follow your nose from here. - If the one you take out is $\cos(x)$, then now we have $\cos(x)dx=d(\sin(x))$. - Again, use Pythagorean identity you can write the remaining expression **entirely in $\sin(x)$**. - Do $u$-substitution with $u=\sin(x)$. Follow your nose from here. **Example.** Find $$ \int \sin^2(x)\cos^3(x)dx $$ $\blacktriangleright$ Note that we have odd powers of $\cos(x)$. So take one out and put it next to $dx$, and follow our nose:$$ \begin{align*} \int \sin^2(x)\cos^3(x)dx & = \int \sin^2(x)\cos^2(x)\cos(x)dx \\ & = \int \sin^2(x)\cos^2(x)d(\sin(x)) \\ & = \int \sin^2(x)(1-\sin^2(x))d(\sin(x)) \\ & = \int u^2(1-u^2)du \quad \text{, with } u=\sin(x) \\ & = \frac{u^3}{3} - \frac{u^5}{5} + C \\ & = \frac{\sin^3(x)}{3} - \frac{\sin^5(x)}{5}+C. \quad\blacklozenge \end{align*} $$ **Case 2: When both $n,m$ are even.** In this case we will run into trouble if we just borrow one factor. So instead we do a different strategy. We repeated apply double angle formulas: > **Double angle formulas.** $$ \begin{align*} \sin^2(x) & =\frac{1}{2}(1-\cos(2x)) \\ \cos^2(x) & =\frac{1}{2}(1+\cos(2x)) \end{align*} $$ By applying the double angle formulas, you should be able to write the entire integrand as some powers of $\cos(2x)$. And go from there: If we can integrate afterwards, great, if we get case 1 or 2 again, rinse and repeat. **Example.** Find $$ \int \sin^4(x) dx $$ $\blacktriangleright$ Here we have only even powers of sines and cosine (cosines being 0 power). So we write it as powers of $\sin^2(x)$ and use double angle formula:$$ \begin{align*} \int\sin^4(x)dx & =\int [\sin^2(x)]^4 dx \\ & = \int \left[ \frac{1}{2}(1-\cos(2x)) \right]^2 dx \\ & =\frac{1}{4}\int1-2\cos(2x)+\cos^2(2x) dx \\ & =\frac{1}{4}\left[x - \sin(2x) +\int \cos^2(2x)dx\right] \\ & =\frac{1}{4}\left[ x-\sin(2x)+\frac{1}{2}\int 1+\cos(4x)dx\right] \\ & =\frac{1}{4}\left[ x-\sin(2x)+\frac{1}{2}\left( x+\frac{1}{4}\sin(4x) \right) \right] + C. \quad\blacklozenge \end{align*} $$ ## Integrals of the form $\int\tan^n(x)\sec^m(x)dx$. **(There were some typos in this section, but they should be corrected now. - B 7/3/2023)** We have similar strategies for products of tangent and secant because they are also algebraically linked as well as analytically linked:$$ \begin{align*} &1+\tan^2(x)=\sec^2(x) \\ &\frac{d}{dx}(\tan(x)) = \sec^2(x) \\ &\frac{d}{dx}(\sec(x)) = \sec(x)\tan(x) \end{align*} $$ ## Case 1: Even power of $\sec(x)$. If we have even power of secant, borrow $\sec^2(x)$ and put it next to $dx$. Then as $\sec^2(x)dx=d(\tan(x))$, this suggests we should write everything in terms of $\tan(x)$, using the identity above if necessary. Then do a $u$-sub with $u=\tan(x)$, and follow your nose. **Example.** Find $$ \int \tan^2(x)\sec^4(x)dx $$ $\blacktriangleright$ Here we have even power of secants. So, borrow $\sec^2(x)$ and put it next to $dx$: $$ \begin{align*} \int\tan^2(x)\sec^4(x)dx & = \int \tan^2(x)\sec^2(x)\sec^2(x)dx \\ & = \int\tan^2(x)\sec^2(x)d(\tan(x)) \\ & = \int\tan^2(x)(1+\tan^2(x))d(\tan(x)) \\ & = \int u^2(1+u^2)du \quad \text{with }u=\tan(x) \\ & = \frac{u^3}{3} + \frac{u^5}{5}+C \\ & = \frac{\tan^3(x)}{3} + \frac{\tan^5(x)}{5}+C. \quad\blacklozenge \end{align*} $$ ## Case 2: Odd power of $\tan(x)$, and at least one copy of secant. If we have odd power of tangent, borrow a product $\sec(x)\tan(x)$ and put it next to $dx$ (Note here we would also require at least one copy of $\sec(x)$ to do this borrowing!). Then as $\sec(x)\tan(x)dx=d(\sec(x))$, we proceed to write everything in terms of $\sec(x)$, and follow your nose. **Example.** Find $$ \int \sec^3(x)\tan^3(x)dx $$ $\blacktriangleright$ Note here we have odd power of tangent and at least one copy of secant, so $$ \begin{align*} \int \sec^3(x)\tan^3(x)dx & = \int\sec^2(x)\tan^2(x)\sec(x)\tan(x)dx\\ & = \int\sec^2(x)\tan^2(x) d(\sec(x)) \\ & = \int\sec^2(x)(\sec^2(x)-1)d(\sec(x)) \\ & = \int u^2(u^2-1) du\quad \text{with } u = \sec(x) \\ & = \frac{u^5}{5} - \frac{u^3}{3} + C \\ & = \frac{\sec^5(x)}{5} - \frac{\sec^3(x)}{3}+C. \quad\blacklozenge \end{align*} $$ Other cases are not as clear sometimes. It would require you to try some manipulations first, and then possibly use the following antiderivatives (let us believe for now): > $$ \begin{align*} \int\tan(x) dx & = \ln|\sec(x)|+C \\ \int\sec(x)dx & =\ln|\sec(x)+\tan(x)|+C \end{align*} $$ **Example: Integral of secant cubed.** This is a classic instructive example. Find $$ \int \sec^3(x)dx $$ $\blacktriangleright$ As this is not one of our cases, we need to do some manipulation first. As the integrand is a product of things, integration by parts come to mind. A natural choice for $dv$ is $\sec^2(x)dx$, as we know $\sec^2(x)dx=d(\tan(x))$. So $$ \begin{align*} \int \sec^3(x)dx & = \int\sec(x) d(\tan(x)) \\ & = \sec(x)\tan(x)- \int\tan(x)d(\sec(x)) \\ & =\sec(x)\tan(x)- \int\tan(x)\sec(x)\tan(x)dx \\ & = \sec(x)\tan(x)-\int\tan^2(x)\sec(x)dx \\ & = \sec(x)\tan(x)-\int(\sec^2(x)-1)\sec(x) dx\\ & = \sec(x)\tan(x)-\int\sec^{3}(x)dx+\int\sec(x)dx \end{align*} $$Wait a minute! We get back to the integral of secant cubed again! We know the drill, give it a name, $I=\int\sec^3(x)dx$, and solve for it, so $$ \begin{align*} I & =\sec(x)\tan(x) -I + \int\sec(x)dx \\ \implies I & = \frac{1}{2}\left[ \sec(x)\tan(x)+\ln|\sec(x)+\tan(x)| \right]+C. \quad\blacklozenge \end{align*} $$ ## Integrals of the form $\int\sin(nx)\cos(mx)dx$ and friends. If instead of powers of $\sin(x)$ and $\cos(x)$ with the same arguments, we have one of $$ \begin{align*} \int \sin(nx)\cos(mx)dx \\ \int \sin(nx)\sin(mx)dx \\ \int \cos(nx)\cos(mx)dx \end{align*} $$Then we can use the trigonometric **product to sum** identities: $$ \begin{align*} \sin(A)\cos(B)=\frac{1}{2}[\sin(A-B)+\sin(A+B)] \\ \sin(A)\sin(B)=\frac{1}{2}[\cos(A-B)-\cos(A+B)] \\ \cos(A)\cos(B)=\frac{1}{2}[\cos(A-B)+\cos(A+B)] \end{align*} $$ **Example.** Find $$ \int\sin(4x)\cos(17x)dx $$ $\blacktriangleright$ Use product to sum formula, $$ \begin{align*} \int\sin(4x)\cos(17x)dx & =\int \frac{1}{2}[\sin(-13x)+\sin(21x)]dx \\ & =\int \frac{1}{2}[-\sin(13x)+\sin(21x)]dx\\ & = \frac{1}{2}\left[ \frac{1}{13}\cos(13x)-\frac{1}{21}\cos(21x) \right]+C.\quad\blacklozenge \end{align*} $$ ## Weierstrass substitution - the world's sneakiest substitution to deal with rational functions of sines and cosines. This is also called the **tangent half-angle substitution**, and it is known at least since Euler in the 1700s, but **misattributed** to Weierstrass (like many things in math, mathematicians are simultaneously good and bad at naming things.) As it turns out, one can evaluate integrals that are **rational functions of $\sin(x)$ and $\cos(x)$**, such as $\displaystyle\frac{1}{1+\sin(x)}$, $\displaystyle \frac{\cos(x)}{\sin(x)-\cos(x)}$, etc. The idea is to use the substitution $\displaystyle t=\tan\left( \frac{x}{2} \right)$, and the integrand will magically become a rational function of $t$, which we can use partial fractions (if necessary) to work it out! Here's the procedure. Given $\displaystyle\int f(\cos(x),\sin(x))dx$, where $f$ is a rational function. Let $t\displaystyle=\tan\left( \frac{x}{2} \right)$. With this substitution, we will also have $$ \begin{align*} \cos(x) & = \frac{1-t^2}{1+t^2} \\ \sin(x) & = \frac{2t}{1+t^2} \\ dx & = \frac{2}{1+t^2} dt \end{align*} $$ Use above substitutions for $\cos(x),\sin(x)$ and $dx$ to express everything in $t$ and $dt$. The new expression is now a rational function in $t$. We can compute it using what we know about integrals of rational functions. And finally, set $t=\tan(\frac{x}{2})$ to convert everything back to $x$. **Example.** Find $$ \int \frac{1}{1+\sin(x)}dx $$ $\blacktriangleright$ Ok this is a rational expression of $\sin(x)$. With $t=\tan(\frac{x}{2})$, and the corresponding pieces $\displaystyle\sin(x)=\frac{2t}{1+t^2}$ and $\displaystyle dx=\frac{2}{1+t^2}dt$, we get $$ \begin{align*} \int \frac{1}{1+\sin(x)}dx & = \int \frac{1}{1+ \frac{2t}{1+t^2}} \frac{2}{1+t^2}dt \\ & = \int \frac{2}{1+t^2+2t}dt \\ & = \int \frac{2}{(1+t)^2} dt \\ & =\int \frac{2}{u^2} du \quad \text{with } u =1+t, du=dt \\ & =-\frac{2}{u} + C \\ & = -\frac{2}{1+t}+C \\ & = -\frac{2}{1 + \tan\left( \frac{x}{2} \right)} + C. \quad\blacklozenge \end{align*} $$ **Example.** Let us find $\displaystyle\int \sec(x)dx$ using Weierstrass substitution. $\blacktriangleright$ Note $\sec(x) = \frac{1}{\cos(x)}$, and with $t=\tan(\frac{x}{2})$, $\cos(x)= \frac{t^2-1}{t^2+1}$, we have $$ \begin{align*} \int \sec(x)dx & =\int \frac{1}{\cos(x)} dx \\ & =\int \frac{t^2+1}{t^2-1} \frac{2dt}{1+t^2} \\ & = 2\int \frac{1}{t^2-1} dt \quad\text{now, pfd}\\ & = 2\int \frac{\frac{-1}{2}}{t+1} + \frac{\frac{1}{2}}{t-1}dt \\ & =-\ln|t+1|+\ln|t-1|+C \\ & =\ln \left| \frac{t-1}{t+1}\right|+C \\ \end{align*} $$ But what is $\left| \frac{t-1}{t+1}\right|$ ? We observe that $\tan(x) = \frac{\sin(x)}{\cos(x)}=\frac{2t}{1-t^2}$ and $\sec(x)=\frac{1}{\cos(x)} = \frac{1+t^2}{1-t^2}$, so $\tan(x)+\sec(x) = \frac{2t+1+t^2}{1-t^2} = \frac{(1+t)^2}{(1+t)(1-t)}=\frac{1-t}{1+t}$. Whence $|\tan(x)+\sec(x)|=\left| \frac{t-1}{t+1}\right|$. So indeed $\displaystyle\int \sec(x)dx = \ln |\tan(x)+\sec(x)|+C$. This perhaps seems "unusual" and there are other ways to find $\int\sec(x)dx$. But many derivations of this will also seem "unusual". The "best" way in my opinion is to use complex numbers........... **Example.** Here's a "unnecessarily complicated example". Find $$ \int \frac{\cos(x)}{\sin(x)-\cos(x)}dx $$ $\blacktriangleright$ Using $\displaystyle t=\tan(\frac{x}{2})$, $\displaystyle\cos(x) = \frac{1-t^2}{1+t^2}$, $\displaystyle\sin(x)=\frac{2}{1+t^2}$, and $\displaystyle dx=\frac{2}{1+t^2}dt$, we have $$ \begin{align*} \int \frac{\cos(x)}{\sin(x)-\cos(x)}dx & = \int \frac{\frac{1-t^2}{1+t^2}}{\frac{2}{1+t^2} - \frac{1-t^2}{1+t^2}} \frac{2}{1+t^2} dt \\ & = \int \frac{\frac{1-t^2}{1+t^2}}{2- (1-t^2)} 2 dt \\ & = 2\int \frac{1-t^2}{(1+t^2)^2}dt \\ & =2\left[ \int \frac{-1}{t^2+1}+\frac{2}{(t^2+1)^2} dt\right] \quad\text{after pfd} \\ & = 2\left[ -\arctan(t) + \frac{2t}{2(t^2+1)}+\arctan(t) \right] +C \end{align*} $$ Where recall yesterday we derived $\int \frac{1}{(1+x^2)^2}dx = \frac{x}{2(x^2+1)} + \frac{1}{2}\arctan(x)+C.$ And finally, let $t=\tan(\frac{x}{2})$ to recover $x$, we get $$ \int \frac{\cos(x)}{\sin(x)-\cos(x)}dx = \frac{2\tan\left( \frac{x}{2} \right)}{\tan^2\left( \frac{x}{2} \right)+1} + C $$ If you plot this you might be surprised. This example we took an "unnecessarily hard way". Do you see why??? (Hint rewrite $\frac{\cos(x)}{\sin(x)-\cos(x)}$ in a more simplified way.) However, if the denominator is a plus sign instead, then we would need to do something like this.... ///